package com.ruoyi.energize.service.impl;

import java.util.List;

import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.energize.mapper.CityMapper;
import com.ruoyi.energize.domain.City;
import com.ruoyi.energize.service.ICityService;

/**
 * city城市名称Service业务层处理
 *
 * @author ruoyi
 * @date 2023-06-07
 */
@Service
public class CityServiceImpl implements ICityService
{
    @Autowired
    private CityMapper cityMapper;

    /**
     * 查询city城市名称
     *
     * @param id city城市名称主键
     * @return city城市名称
     */
    @Override
    public City selectCityById(Integer id)
    {
        return cityMapper.selectCityById(id);
    }

    /**
     * 查询city城市名称列表
     *
     * @param city city城市名称
     * @return city城市名称
     */
    @DataSource(DataSourceType.ZJPAY)
    @Override
    public List<City> selectCityList(City city)
    {
        return cityMapper.selectCityList(city);
    }

    /**
     * 新增city城市名称
     *
     * @param city city城市名称
     * @return 结果
     */
    @Override
    public int insertCity(City city)
    {
        return cityMapper.insertCity(city);
    }

    /**
     * 修改city城市名称
     *
     * @param city city城市名称
     * @return 结果
     */
    @Override
    public int updateCity(City city)
    {
        return cityMapper.updateCity(city);
    }

    /**
     * 批量删除city城市名称
     *
     * @param ids 需要删除的city城市名称主键
     * @return 结果
     */
    @Override
    public int deleteCityByIds(Integer[] ids)
    {
        return cityMapper.deleteCityByIds(ids);
    }

    /**
     * 删除city城市名称信息
     *
     * @param id city城市名称主键
     * @return 结果
     */
    @Override
    public int deleteCityById(Integer id)
    {
        return cityMapper.deleteCityById(id);
    }
}
